package com.testmanager.testmananger.ArithMetic;

public class Sort {

    public static void maopao(int[] arr){
        boolean isChange = false;
        int  i,j;
        for(i =0;i<arr.length-1;i++){
            for ( j=i;j<arr.length-i-1;j++){
                int temp;
                if (arr[j] > arr[j+1]){
                    temp = arr[j];
                    arr[j] = arr[j+1];
                    arr[j+1]=temp;
                    isChange = true;
                }

            }
            if (!isChange){
                return;
            }


        }

    }

    public static void main(String[] args) {
        int[] arr = {1,3,4,5,7,4};
        maopao(arr);
        System.out.println(arr);


    }

}
